<%--
  Created by IntelliJ IDEA.
  User: Elvira Aranda
  Date: 30/05/2010
  Time: 06:39:18 PM
  To change this template use File | Settings | File Templates.
--%>

<%@ page import="com.spheres.quiniela.domain.Team; com.spheres.quiniela.domain.FixtureNumber" contentType="text/html;charset=UTF-8" %>
<html>
  <head><title>Simple GSP page</title></head>
  <body>

  <div style="width:250px;float:left">
    <h2>Jornadas</h2>
    <ul>
      <g:each in="${FixtureNumber.getAll()}" var="fixtureNumber">
        <li><g:link action="matchAdmin" params="[fixtureNumber:fixtureNumber.id]">${fixtureNumber.description}</g:link></li>
      </g:each>

    </ul>
  </div>
  <div style="float:left">
    <g:if test="${currentFixtureNumber}">
      <g:if test="${flash.message}">${flash.message}</g:if>
      <table width="100%">
        <caption>${currentFixtureNumber.description}</caption>
        <g:each in="${matches}" var="match">
            <tr>
              <td>${match.local.name}</td>
               <td>${match.visitor.name}</td>
              <td>Editar  Resultados</td>
            </tr>
        </g:each>

        <tr>
          <td colspan="3">
            <g:form action="createMatch">
              <g:hiddenField value="${currentFixtureNumber.id}" name="fixtureNumber.id" />
              <g:select from="${Team.getAll()}" name="local.id" optionKey="id" optionValue="name" noSelection="['':'seleccione']" />
              <g:select from="${Team.getAll()}" name="visitor.id" optionKey="id" optionValue="name" noSelection="['':'seleccione']" />
              <g:datePicker name="date" value="${new Date()}" precision="day" />
              <g:submitButton name="create" value="Guardar" />
            </g:form>
          </td>
        </tr>
      </table>
     </g:if>
  </div>

  </body>
</html>